''''''
'''设置中间件'''

#保持浏览记录
class UrlMiddleware(object):
    def process_view(self, request, view_fun, view_args, views_kwargs):
        #需要排除的路径列表
        urls = [
            '/user/login/',
            '/user/logout/',
            '/user/login_handle/',
            '/user/register',
            '/user/register_handle',
            '/user/register_active/',  #todo 这个处理有问题
            '/user/check/',
            '/cart/add/',
            '/cart/cartnum/',

        ]
        # request.META.get('HTTP_REFERER', '/')

        # url(r'^register_active/(\d+)/$', views.register_active),

        if request.path not in urls:
            request.session['url'] = request.get_full_path()
            # request.session['url'] = request.META.get('HTTP_REFERER', '/')


#todo 前提是你已经学过javascript/html
'''
js内置对象int float function
DOM对象:指js获取的html元素,常用window,document
        比方一个span标签,用document去获取
        <span id='show'></span>
        show = document.getElementsById('show')
jquery对象:$('')
        现在普遍都用jquery对象,所以很少有说DOM对象的了
'''

